package day10.supermarket;

/**
 * @author oldliu
 * @since 1.0
 */
//定时保存
public class SaveThread extends Thread {
    private Market market;//=Market.getMarket();
    public SaveThread(Market m){
        this.market=m;
    }

    @Override
    public void run() {
        while (true){
            try {
                sleep(15000);
                Market.setMarket(this.market);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
